<% content_for "modal_for_#{attribute}" do %>

  <% new_page_title = t('typus.resources.add.title', resource: related.model_name.human.titleize) %>

  <div id="modal-from-dom-<%= attribute_id %>" class="modal fade">
    <div class="modal-dialog">
      <div class="modal-content">

        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
          <h4 class="modal-title"><%= new_page_title %></h4>
        </div>

        <div class="modal-body"></div>

        <div class="modal-footer">
          <% html_options = { id: 'modal-form-submit', class: 'btn btn-primary' } %>
          <%= link_to t('typus.buttons.save'), { anchor: '', _continue: true }, html_options %>
        </div>

        <%= render partial: 'admin/templates/modals/popup', locals: { related: related, attribute_id: attribute_id } %>

      </div>
    </div>
  </div>

<% end %>
